﻿using MengLin.OOP.DesignPattern.Visitor.StudentGetVdieo.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Visitor.StudentGetVdieo.Visitor
{
    /// <summary>
    /// 以前政策的访问者
    /// 完成获取视频的行为
    /// </summary>
    public class VistorPast : IVisitor
    {
        /// <summary>
        /// 免费学员获取视频
        /// </summary>
        /// <param name="studentFree"></param>
        public void GetVideoFree(StudentFree studentFree)
        {
            if (DateTime.Now.ToFileTime() >= 11)//11点前
            {
                Console.WriteLine("只能获取当次课的公开课视频的上集。");
            }
            else if (DateTime.Now.ToFileTime() >= 14)//14点前
            {
                Console.WriteLine("只能获取当次课的公开课视频的中集。");
            }
            else if (DateTime.Now.ToFileTime() >= 17)//17点前
            {
                Console.WriteLine("只能获取当次课的公开课视频的下集。");
            }
            Console.WriteLine("只能获取当次课的公开课视频代码合集。");
        }

        /// <summary>
        /// Vip学员获取视频
        /// </summary>
        /// <param name="studentFree"></param>
        public void GetVideoVip(StudentVip studentVip)
        {
            if (DateTime.Now.ToFileTime() >= 11)//11点前
            {
                Console.WriteLine("免费获取全套的公开课视频的上集。");
            }
            else if (DateTime.Now.ToFileTime() >= 14)//14点前
            {
                Console.WriteLine("免费获取全套的公开课视频的中集。");
            }
            else if (DateTime.Now.ToFileTime() >= 17)//17点前
            {
                Console.WriteLine("免费获取全套的公开课视频的下集。");
            }
            Console.WriteLine("免费获取全套的公开课视频代码合集。");
        }
    }
}
